<?php
	set_time_limit(0);
	$host="127.0.0.1";
	$port=9526;
	$socket=socket_create(AF_INET,SOCK_STREAM,SOL_TCP) or die("cannot create socket");
	$conn = socket_connect($socket, $host,$port) or die("cannot connect server\n");
	if ($conn) {echo "client connect ok<br>";}
	$msg="hello sever\r\n";
	socket_write($socket, $msg,strlen($msg)) or die ("cannot write data\n");
	$buffer = socket_read($socket,1024,PHP_NORMAL_READ);
	if ($buffer){
		echo "response was:<br>".$buffer."\n";
		socket_close($socket);
	}
	g
?>
 